package com.users.util;

import java.net.InetAddress;
import java.net.UnknownHostException;

public class IPUtils{
	public static String getMyIP() {
		InetAddress myIPaddress = null;
		String hostAddress = null;
		String hostName = null;
		try {
			myIPaddress = InetAddress.getLocalHost();
			hostAddress = myIPaddress.getHostAddress();
			hostName = myIPaddress.getHostName();
		} catch (UnknownHostException e) {
		}
		return hostAddress;
	}
	public static void main(String[] args) {
		System.out.println(new IPUtils().getMyIP());
	}
}
